package com.sleep.drug_traceability.service;

import com.sleep.drug_traceability.dao.pojo.User;
import com.sleep.drug_traceability.vo.Result;
import com.sleep.drug_traceability.vo.params.LoginParam;
import com.sleep.drug_traceability.vo.params.RegisterParam;

/**
 * @author Sleep-6000
 * @date 2022/4/23
 */
public interface LoginService {
    /**
     * 登录
     * @param loginParam loginParam
     * @return token、id、type、isPerfect
     */
    Result login(LoginParam loginParam);

    /**
     * 校验 token 合法性
     * @param token token
     * @return SysUser
     */
    User checkToken(String token);

    /**
     * 退出
     * @param token token
     * @return null
     */
    Result logout(String token);

    /**
     * 注册
     * @param registerParam registerParam
     * @return token
     */
    Result register(RegisterParam registerParam);
}
